/*
 * ResultsDialog.java
 * 
 * Copyright 2008 David D. Emory
 * 
 * This file is part of Five Points. See <http://www.fpdev.org> for
 * additional information regarding the project.
 * 
 * Five Points is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Five Points is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Five Points.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.fpdev.apps.rtemaster.gui.dialogs;

import org.fpdev.apps.rtemaster.gui.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

public class ResultsDialog extends JDialog implements ActionListener {

  private JTextArea textArea_;
  private JButton closeBtn_;

  public ResultsDialog(RMGUI gui, String results) {
    super(gui);
    textArea_ = new JTextArea(results, 20, 60);
    textArea_.setLineWrap(true);
    textArea_.setWrapStyleWord(true);
    JScrollPane scrollPane = new JScrollPane(textArea_);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setBorder(BorderFactory.createLoweredBevelBorder());

    closeBtn_ = new JButton("Close Window");
    closeBtn_.addActionListener(this);

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    getContentPane().add(closeBtn_, BorderLayout.SOUTH);


    this.pack();
    show();
  }

  public void actionPerformed(ActionEvent e) {

    if (e.getSource() == closeBtn_) {
      this.hide();
    }
  }
}




























